package cn.fanqinghong.ymcc.feignclient;

import cn.fanqinghong.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * FAN
 * 2022/7/27  14:56
 */
@Component
public class MediaFileFallbackFactory implements FallbackFactory<MediaFileFeignClient> {
    @Override
    public MediaFileFeignClient create(Throwable throwable) {
        return new MediaFileFeignClient() {
            @Override
            public JSONResult searchInfo(Long courseId) {
                return JSONResult.error("获取课程视频失败");
            }
        };
    }
}
